#include<iostream>
#include<algorithm>
#include<cstring>
#include<unordered_set>
#include<set>
#include<map>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10, M = 1e5 + 10;
int h[N], e[M], ne[M], idx;
int ans[N];
int n, m;
void add(int a, int b)
{
	e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
void dfs(int u, int d)
{
	if (ans[u])return;
	ans[u] = d;
	for (int i = h[u]; ~i; i = ne[i]) {
		int j = e[i];
		dfs(j, d);
	}
}
int main()
{
	cin >> n >> m;
	memset(h, -1, sizeof(h));
	while (m--) {
		int a, b;
		cin >> a >> b;
		add(b, a);
	}
	for (int i = n; i; i--)	dfs(i, i);
	for (int i = 1; i <= n; i++)cout << ans[i] << " ";
	return 0;
}